#!/bin/sh
# This regression test is a part of SIPp.
# A 180 that arrives after the 200 it preceded (UDP can reorder them) is
# stale and must be ignored, not abort the call as unexpected.
. "`dirname "$0"`/../functions"; init

sippbg -sf uas.xml -i 127.0.0.1 -p 5070 -m 1
sippfg -sn uac -i 127.0.0.1 -p 5071 -m 1 -d 200 127.0.0.1:5070 \
    -timeout 6 -timeout_error >/dev/null 2>&1
status=$?

if test $status -eq 0; then
    ok
else
    fail "UAC failed with $status on the late 180"
fi
